const express = require('express');
const router = express.Router();
const config=require('../config');
const Wechat=require('../weichat/accessToken');
/**首页路由 */
router.get('/', async(req, res) =>{
    const w=new Wechat();
    const ticket=await w.getJsTicket();
    let options={
        appId:config.appID,
        timestamp:Date.now(),// 时间戳
        nonceStr: Math.floor(Math.random()*10)+1, // 必填，生成签名的随机串
        signature: ticket,// 必填，签名
    }
    res.render('index',options);
});

module.exports = router;
